﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace STS.Pacjent
{
    public partial class pokazBadania : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            Master.FindControl("NavigationMenuR").Visible = false;
            if (Main.idpacjenta == 0)
            {
                tekst.Text = "Wybierz pacjenta!";
                tekst.Visible = true;
                DropDownList1.Visible = false;
                OK.Visible = false;
                Panel1.Visible = false;
            }
            else
            {

                id_pacjenta.Text = Main.idpacjenta.ToString();
                Panel1.Visible = false;
            }
        }

        protected void OK_Click(object sender, EventArgs e)
        {
            Panel1.Visible = true;
            baza db = new baza();
            var ud = db.badanias.SingleOrDefault(fbu => fbu.id_badania == Convert.ToInt32(DropDownList1.SelectedValue));
            nazwa.Text = ud.nazwa_badania;
            opis.Text = ud.opis_badania;
            data.Text = ud.data.ToString();
            Image1.ImageUrl = "~/Obraz.ashx?Id=" + DropDownList1.SelectedValue;
        }
    }
}